#include <ros/ros.h>
#include <nav_msgs/Odometry.h>

void speedCallback(const nav_msgs::Odometry::ConstPtr &msg)
{
  ROS_INFO("Car linear velocity: vx=%0.6f, vy=%0.6f, vz=%0.6f", msg->twist.twist.linear.x, msg->twist.twist.linear.y, msg->twist.twist.linear.z);
  ROS_INFO("Car angular velocity: wx=%0.6f, wy=%0.6f, wz=%0.6f", msg->twist.twist.angular.x, msg->twist.twist.angular.y, msg->twist.twist.angular.z);
  return;
}

int main(int argc, char **argv)
{
  ros::init(argc, argv, "speed_subscriber");
  ros::NodeHandle nh;
  ros::Subscriber speed_sub = nh.subscribe("/odom", 10, speedCallback);
  ros::spin();
  return 0;
}